package org.rabbitmq.topic.provider.service.support;

import org.rabbitmq.topic.common.enums.ExchangeEnum;
import org.rabbitmq.topic.provider.service.QueueMessageService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
*@author LSY
*Time: 2018年12月7日下午2:16:22
*
*
*/
@Component
public class QueueMessageServiceSupport implements QueueMessageService{

	@Autowired
	private RabbitTemplate rabbitTemplate;
	@Override
	public void send(Object message, ExchangeEnum exchangeEnum, String routingKey) throws Exception {

		rabbitTemplate.convertAndSend(exchangeEnum.getName(), routingKey, message);
	}

	
}
